import App from './App'
import {
	request,
	showToast,
} from "@/utils/request.js"
import api from "@/utils/api.js"
import baseUrl from "@/utils/config.js"
import share from '@/utils/share.js'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
Vue.mixin(share)
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  app.config.globalProperties.$baseUrl = baseUrl;
  app.config.globalProperties.$imagesUrl = baseUrl + 'images/';
  app.config.globalProperties.$request = request;
  app.config.globalProperties.$showToast = showToast;
  app.config.globalProperties.$api = api;
  return {
    app
  }
}
// #endif